package com.yidu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.yidu.bean.TbImage;
import com.yidu.dao.TbImageMapper;
import com.yidu.message.Page;
import com.yidu.service.TbImageService;

@Service
public class TbImageImpl implements TbImageService {

	Logger logger = Logger.getLogger(TbImageImpl.class);
	
	@Resource
	private TbImageMapper imageDao;
	
	@Override
	public int delete(String imgId) {
		logger.info("进入删除方法...");
		int num  =imageDao.deleteByPrimaryKey(imgId);
		return num;
	}

	@Override
	public int save(TbImage image) {
		logger.info("进入增加方法...");
		int num = imageDao.insertSelective(image);
		return num;
	}

	@Override
	public int update(TbImage image) {
		logger.info("进入修改方法..."); 
		int num = imageDao.updateByPrimaryKey(image);
		return num;
	}

	@Override
	public List<TbImage> findVague(Page page, TbImage image) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public TbImage findById(String yewuID) {
		TbImage img = imageDao.findById(yewuID);
		return img;
	}

	@Override
	public List<TbImage> findByIds(String yewuID) {
		List<TbImage> list=  imageDao.findByIds(yewuID);
		return list;
	}

}
